home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-03-19 | 1.5 KB | 67 lines | [TEXT/MPS ] |
- //---------------------------------------------------------------------
- //
- // Copyright © 1992 David Peterson.
- // All rights reserved.
- //
- // Permission to use, copy, modify, and distribute this software for
- // any purpose and without fee is hereby granted, provided that the
- // above copyright notice appear in all copies and that both that
- // copyright notice and this permission notice appear in supporting
- // documentation.
- //
- //---------------------------------------------------------------------
-
- #ifndef __CQUEUE__
- #define __CQUEUE__
-
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifdef HANDLEQUEUES
- class CQueue : public HandleObject {
- #else
- class CQueue {
- #endif
- public:
- QHdr fFreeQueue; // pb available for use
- QHdr fInUseQueue; //
- QHdr fCompletedQueue; // should be added here in completion proc
- QHdr fProcessingQueue; //
-
- int fNumPBs; // number we had to begin with
-
- int fFree; // number available
- int fInUse;
- int fCompleted; // number completed
- int fProcessing;
-
- CQueue();
- virtual ~CQueue();
-
- Boolean AllocPBs(int howmany, int size);
-
- int NumCompleted() { return fCompleted; }
-
- ParmBlkPtr GetUnusedPB();
-
- void StoreCompletedPB(ParmBlkPtr pb);
- ParmBlkPtr GetCompletedPB();
-
- void RecyclePB(ParmBlkPtr pb);
-
- ParmBlkPtr CleanQs();
-
- private:
- ParmBlkPtr CleanFreeQ();
- ParmBlkPtr CleanInUseQ();
- ParmBlkPtr CleanCompletedQ();
- ParmBlkPtr CleanProcessingQ();
-
- };
-
- #endif
-